<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
 	xmlns:ui="http://java.sun.com/jsf/facelets"
 	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
 	xmlns:p="http://primefaces.org/ui" >
 
 <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="./resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        
        
        <script src="./resources/js/jquery.min.js" type="text/javascript"></script>
        <script src="./resources/js/jquery.maskedinput-1.3.js" type="text/javascript"/>
        <script type="text/javascript">
            
           $(document).ready(function(){
            $(".data").mask("99/99/9999");
            
            
            
            });
            
        </script>
        <title>Minha Agenda Médica</title>
    </h:head>
    
    <h:body>
    <div id="logo"><img src="../resources/icons/logo.png"/>
</div>
			<div style="text-align:center;font-size:15px;"><h3>Consultas Marcadas</h3></div>
	
 	<fieldset style="width: 630px;margin:auto;box-shadow:0px 5px 8px 3px #BBB;">
 	<legend><font size="2"> Consultas Marcadas</font></legend>
 <p:messages/>
 
 <h:form  id="dadosCliente">
 <div id="medico">
 <h:outputText value="Médico: "/><br></br>
 	<h:outputText value="#{sessionScope.usuario.nome}" />
 
 </div>
 
 <div id="data">
 <h:outputText value="Data: "/><br></br>
 <h:inputText value="#{agendaManager.dataAgenda}" styleClass="data"/>
 
 <h:commandButton value="Filtrar" actionListener="#{agendaManager.pesquisaConsultaMarcadaMedico}"/>
 </div>
 <div id="button4">         
<button> <a href="indexMedico.xhtml"> Voltar </a></button>
</div>
 </h:form>
 </fieldset>
 
 <br></br>
 <br></br>

	
<fieldset style="width: 630px;margin:0 auto;box-shadow:0px 5px 8px 3px #BBB;margin-top: -30px;height:auto;">

 <div id="tabela1">
 <br></br>

  <h:form>	
		 
 <h:dataTable value="#{agendaManager.listAgenda}" var="consulta" columns="2" border="1" cellpadding="0" cellspacing="2"><b></b>
 
 	<h:column>
 	  <f:facet name="header" > <h:outputText value="Data"/></f:facet>
 	   	
 	   	<h:outputText value="#{consulta.data}">
 	   		 <f:convertDateTime locale="pt,Br" timeZone="GMT-03:00" pattern="dd/MM/yyyy" /> 
 	   	</h:outputText>
 	</h:column>
 	
 		<h:column>
 	  <f:facet name="header"> <h:outputText value="Hora de início"/></f:facet>
 	   	
 	   	<h:outputText value="#{consulta.HInicio}"/>
 	</h:column>
 	
 		<h:column>
 	  <f:facet name="header"> <h:outputText value="Hora de termino"/></f:facet>
 	   	
 	   	<h:outputText value="#{consulta.HFinal}"/>
 	   	
 	</h:column>
	
		<h:column>
 	  <f:facet name="header"> <h:outputText value="Paciente"/></f:facet>
 	   	
 	   		<h:outputText value="#{consulta.paciente.nome}"/>
 	   	
 	</h:column>
	
	
		<h:column>	
		
		 
 	   			   		
 	
 		   	<h:commandButton  value="Desmarcar" action="consultasMarcadas.xhtml"	 actionListener="#{agendaManager.desmarcarConsulta}">
 	   		
 	   			<f:attribute name="codigo" value="#{consulta.id}" />  
 	   			
 	   		</h:commandButton> 	
 			  	   	
	 	 
 	</h:column> 
 		

 </h:dataTable>
</h:form>

 
 </div>
 </fieldset>
 
 
 		
 		
 </h:body>
 
</html>